"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const taro_1 = require("@tarojs/taro");
const react_1 = require("react");
const lodash_1 = require("lodash");
const taro_ui_1 = require("taro-ui");
const Tabbar = () => {
    const [current, setCurrent] = react_1.useState(0);
    const handleClick = (value) => {
        const userInfo = taro_1.default.getStorageSync("userInfo");
        setCurrent(value);
        if (value === 1 && !lodash_1.isEmpty(userInfo)) {
            taro_1.default.redirectTo({
                url: "/pages/person/person"
            });
        }
        if (value === 1 && lodash_1.isEmpty(userInfo)) {
            taro_1.default.navigateTo({
                url: "/components/login/login"
            });
        }
    };
    return (<taro_ui_1.AtTabBar fixed tabList={[
        { title: "首页", iconType: "home" },
        { title: "我的", iconType: "user" }
    ]} onClick={res => handleClick(res)} current={current}/>);
};
exports.default = Tabbar;
//# sourceMappingURL=tabbar.jsx.map